const express = require('express');
const router = express.Router();
const Auth = require('../middleware/auth');
const Cache = require('../middleware/cache');

const orderController = require('../controllers/order')

router.post('/', Auth, orderController.order_add);
router.patch('/:oid', Auth, orderController.order_update);
router.get('/:page', Auth, Cache, orderController.order_get_all);
router.get('/detail/:oid', Auth, Cache, orderController.order_getById);
router.delete('/:oid', Auth, orderController.order_delete);

module.exports = router;